package com.siwei.mes.entity.sync.erp;

import com.siwei.mes.sync.erp.entity.SyncSupplierCompanyMaterials;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;


/**
 * ERP-供应商原材料(ErpSupplierCompanyMaterials)实体类
 *
 * @author linzi
 * @since 2024-08-17 09:51:17
 */
@Data
@Accessors(chain = true)
@Table(name = "erp_supplier_company_materials")
@ApiModel(value = "ErpSupplierCompanyMaterials", description = "ERP-供应商原材料")
public class ErpSupplierCompanyMaterials implements Serializable {
    private static final long serialVersionUID = 763388949898058379L;
    /**
     * 主键id
     */
    @Id
    @ApiModelProperty(value = "ERP-供应商原材料主键ID", name = "id")
    private Long id;
    /**
     * 供货单位材料关系ID主键
     */
    @Column(name = "CYRID")
    @ApiModelProperty(value = "供货单位材料关系ID主键", name = "cyrid")
    private Integer cyrid;
    /**
     * 供货单位ID
     */
    @Column(name = "YCID")
    @ApiModelProperty(value = "供货单位ID", name = "ycid")
    private Long ycid;
    /**
     * 供货单位名称
     */
    @Column(name = "yclCompanyName")
    @ApiModelProperty(value = "供货单位名称", name = "yclcompanyname")
    private String yclcompanyname;

    /**
     * 原材料类型 粗骨料，细骨料，水泥，矿粉，水，掺合料，外加剂，其他
     */
    @Column(name = "category")
    @ApiModelProperty(value = "原材料类型  粗骨料，细骨料，水泥，矿粉，水，掺合料，外加剂，其他 ")
    private String category;
    /**
     * 原材料名称
     */
    @Column(name = "yclName")
    @ApiModelProperty(value = "原材料名称", name = "yclname")
    private String yclname;
    /**
     * 品种规格
     */
    @Column(name = "pzgg")
    @ApiModelProperty(value = "品种规格", name = "pzgg")
    private String pzgg;
    /**
     * ycl+pzgg的唯一键
     */
    @Column(name = "yclkey")
    @ApiModelProperty(value = "ycl+pzgg的唯一键	", name = "yclkey")
    private String yclkey;
    /**
     * 状态 1：有效 0：无效
     */
    @Column(name = "state")
    @ApiModelProperty(value = "状态 1：有效 0：无效	", name = "state")
    private String state;
    /**
     * 含水率% 0-100
     */
    @Column(name = "rateofwater")
    @ApiModelProperty(value = "含水率% 0-100	", name = "rateofwater")
    private Float rateofwater;
    /**
     * 扣杂
     */
    @Column(name = "kz")
    @ApiModelProperty(value = "扣杂", name = "kz")
    private Float kz;
    /**
     * 扣杂形式 1：%, 2：kg
     */
    @Column(name = "kzType")
    @ApiModelProperty(value = "扣杂形式 1：%, 2：kg	", name = "kztype")
    private Integer kztype;
    /**
     * 容重
     */
    @Column(name = "rz")
    @ApiModelProperty(value = "容重", name = "rz")
    private String rz;

    /*
     * 创建时间
     */
    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间", name = "createTime")
    private Date createTime;
    /**
     * 更新时间
     */
    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间", name = "updateTime")
    private Date updateTime;
    /**
     * 是否删除  1-删除
     */
    @Column(name = "is_del")
    @ApiModelProperty(value = "是否删除  1-删除", name = "isDel")
    private Integer isDel;

    public static ErpSupplierCompanyMaterials payloadInfo(SyncSupplierCompanyMaterials supplierCompanyMaterials) {
        ErpSupplierCompanyMaterials erpSupplierCompanyMaterials = new ErpSupplierCompanyMaterials();
        erpSupplierCompanyMaterials.setCyrid(supplierCompanyMaterials.getCYRID());
        erpSupplierCompanyMaterials.setYcid(supplierCompanyMaterials.getYCID());
        erpSupplierCompanyMaterials.setYclcompanyname(supplierCompanyMaterials.getYclCompanyName());
        erpSupplierCompanyMaterials.setCategory(supplierCompanyMaterials.getCategory());
        erpSupplierCompanyMaterials.setYclname(supplierCompanyMaterials.getYclName());
        erpSupplierCompanyMaterials.setPzgg(supplierCompanyMaterials.getPzgg());
        erpSupplierCompanyMaterials.setYclkey(supplierCompanyMaterials.getYclkey());
        erpSupplierCompanyMaterials.setState(supplierCompanyMaterials.getState());
        erpSupplierCompanyMaterials.setRateofwater(supplierCompanyMaterials.getRateofwater());
        erpSupplierCompanyMaterials.setKz(supplierCompanyMaterials.getKz());
        erpSupplierCompanyMaterials.setKztype(supplierCompanyMaterials.getKzType());
        erpSupplierCompanyMaterials.setRz(String.valueOf(supplierCompanyMaterials.getRz()));
        return erpSupplierCompanyMaterials;
    }
}
